package pkmn.type;

public class Type{
    private TypeEnum typeEnum;
    
    public TypeEnum getTypeEnum(){
        return typeEnum;
    }
    
    public void setTypeEnum(TypeEnum typeEnum){
        this.typeEnum = typeEnum;
    }

    public double effective(Type type){
        return 1.0;
    }

    public boolean equals(Type type){
        return this.typeEnum == type.getTypeEnum();
    }

    @Override
    public String toString(){
        return this.getClass().getSimpleName();
    }

    public static Type newByName(String name) throws Exception{
        Class classe = Class.forName("pkmn.type." + name);
        return (Type) classe.newInstance();
    }
}